﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;

namespace ERP_RORZE_ORDER.OrderObject.UserControls
{
    public partial class ucOrderMain : DevExpress.XtraEditors.XtraUserControl
    {
        private int reportNameParent;
        private string captionParent;
        public ucOrderMain(int reportName=0, string caption=null)
        {
            InitializeComponent();

            this.reportNameParent = reportName;
            this.captionParent = caption;
        }

        private void navProduct_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e)
        {
            Cursor.Current = Cursors.WaitCursor;

            ucProduct uc = new ucProduct();
            this.panelRight.Controls.Clear();
            this.panelRight.Controls.Add(uc);
            uc.Dock = DockStyle.Fill;

            Cursor.Current = Cursors.Default;
        }

        private void navProductGroup_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e)
        {
            Cursor.Current = Cursors.WaitCursor;

            ucProductGroup uc = new ucProductGroup();
            this.panelRight.Controls.Clear();
            this.panelRight.Controls.Add(uc);
            uc.Dock = DockStyle.Fill;

            Cursor.Current = Cursors.Default;
        }

        private void navCurrency_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e)
        {
            Cursor.Current = Cursors.WaitCursor;

            ucCurrency uc = new ucCurrency();
            this.panelRight.Controls.Clear();
            this.panelRight.Controls.Add(uc);
            uc.Dock = DockStyle.Fill;

            Cursor.Current = Cursors.Default;
        }

        private void navUnit_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e)
        {
            Cursor.Current = Cursors.WaitCursor;

            ucUnit uc = new ucUnit();
            this.panelRight.Controls.Clear();
            this.panelRight.Controls.Add(uc);
            uc.Dock = DockStyle.Fill;

            Cursor.Current = Cursors.Default;
        }

        private void navPGroup_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e)
        {
            Cursor.Current = Cursors.WaitCursor;

            ucPGroup uc = new ucPGroup();
            this.panelRight.Controls.Clear();
            this.panelRight.Controls.Add(uc);
            uc.Dock = DockStyle.Fill;

            Cursor.Current = Cursors.Default;
        }

        private void navSupplier_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e)
        {
            Cursor.Current = Cursors.WaitCursor;

            ucSupplier uc = new ucSupplier();
            this.panelRight.Controls.Clear();
            this.panelRight.Controls.Add(uc);
            uc.Dock = DockStyle.Fill;

            Cursor.Current = Cursors.Default;
        }

        private void navPurchaser_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e)
        {
            Cursor.Current = Cursors.WaitCursor;

            ucPurchaser uc = new ucPurchaser();
            this.panelRight.Controls.Clear();
            this.panelRight.Controls.Add(uc);
            uc.Dock = DockStyle.Fill;

            Cursor.Current = Cursors.Default;
        }

        private void navOrder_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e)
        {
            Cursor.Current = Cursors.WaitCursor;

            ucOrder uc = new ucOrder();
            this.panelRight.Controls.Clear();
            this.panelRight.Controls.Add(uc);
            uc.Dock = DockStyle.Fill;

            Cursor.Current = Cursors.Default;
        }

        private void navPurpose_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e)
        {
            Cursor.Current = Cursors.WaitCursor;

            ucPurpose uc = new ucPurpose();
            this.panelRight.Controls.Clear();
            this.panelRight.Controls.Add(uc);
            uc.Dock = DockStyle.Fill;

            Cursor.Current = Cursors.Default;
        }

        private void navKind_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e)
        {
            Cursor.Current = Cursors.WaitCursor;

            ucKind uc = new ucKind();
            this.panelRight.Controls.Clear();
            this.panelRight.Controls.Add(uc);
            uc.Dock = DockStyle.Fill;

            Cursor.Current = Cursors.Default;
        }

        private void navMaker_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e)
        {
            Cursor.Current = Cursors.WaitCursor;

            ucMaker uc = new ucMaker();
            this.panelRight.Controls.Clear();
            this.panelRight.Controls.Add(uc);
            uc.Dock = DockStyle.Fill;

            Cursor.Current = Cursors.Default;
        }

        private void navOrderInput_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e)
        {
            Cursor.Current = Cursors.WaitCursor;

            ucOrderInput uc = new ucOrderInput();
            this.panelRight.Controls.Clear();
            this.panelRight.Controls.Add(uc);
            uc.Dock = DockStyle.Fill;

            Cursor.Current = Cursors.Default;
        }

        private void navOrderDelivery_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e)
        {
            Cursor.Current = Cursors.WaitCursor;

            ucOrderDelivery uc = new ucOrderDelivery();
            this.panelRight.Controls.Clear();
            this.panelRight.Controls.Add(uc);
            uc.Dock = DockStyle.Fill;

            Cursor.Current = Cursors.Default;
        }

        public void BindaData(int reportName = 0, string caption = null)
        {
            Cursor.Current = Cursors.WaitCursor;

            ucReportGrid uc = new ucReportGrid(reportName, caption);
            this.panelRight.Controls.Clear();
            this.panelRight.Controls.Add(uc);
            uc.Dock = DockStyle.Fill;

            Cursor.Current = Cursors.Default;
        }

        public void Print()
        {
            Cursor.Current = Cursors.WaitCursor;

            ucPrint uc = new ucPrint();
            this.panelRight.Controls.Clear();
            this.panelRight.Controls.Add(uc);
            uc.Dock = DockStyle.Fill;

            Cursor.Current = Cursors.Default;
        }

        public void GetAllOrderData()
        {
            Cursor.Current = Cursors.WaitCursor;

            ucOrderData uc = new ucOrderData();
            this.panelRight.Controls.Clear();
            this.panelRight.Controls.Add(uc);
            uc.Dock = DockStyle.Fill;

            Cursor.Current = Cursors.Default;
        }
    }
}
